//
//  CodeSnippets.h
//  RBDemoProj
//
//  Created by Lan on 2019/1/21.
//  Copyright © 2019年 SummerTea. All rights reserved.
//  快捷代码块,备忘

~/Library/Developer/Xcode/UserData/CodeSnippets

#pragma mark - ################################

xassign
@property(nonatomic, assign) <#type#> <#name#>;

#pragma mark - ################################
xcopy
@property(nonatomic, copy) <#des#>;

#pragma mark - ################################
xiboutlet

@property(nonatomic, strong)IBOutlet <#type#> *<#name#>;

#pragma mark - ################################
xstring

@property(nonatomic, copy) NSString *<#name#>;

#pragma mark - ################################
xstrong

@property(nonatomic, strong) <#type#> *<#name#>;

#pragma mark - ################################
xweak

@property(nonatomic, weak) <#type#> *<#name#>;

#pragma mark - ################################
xwhite

/**<<#des#>*/

#pragma mark - ################################
snow

/** <#des#> */

#pragma mark - ################################
xmark

#pragma mark - <#des#>

#pragma mark - ################################
xself

__weak typeof(self) weak_self = self;

#pragma mark - ################################
xselfstrong

__strong typeof(weak_self) strong_self = weak_self;

#pragma mark - ################################
xdatasource

- (NSMutableArray *)dataSource
{
    if (!_dataSource)
    {
        self.dataSource = ({
            NSMutableArray *arrayM = [NSMutableArray array];
            arrayM;
        });
    }
    return _dataSource;
}

#pragma mark - ################################
ximage

UIImageView *view = [UIImageView new];
view.contentMode = UIViewContentModeScaleAspectFill;
view.clipsToBounds = YES;

#pragma mark - ################################
xlabel

UILabel *view = [UILabel new];
view.textColor = [UIColor blackColor];
view.font = [UIFont systemFontOfSize:13];
view.numberOfLines = 1;
view.textAlignment = NSTextAlignmentLeft;
view.tag = 100;
view.backgroundColor = [UIColor purpleColor];
view.verticalAligent = UIViewContentAligentCenter;


#pragma mark - ################################
xtableview

- (UITableView *)tableView
{
    if (!_tableView) {
        self.tableView = ({
            UITableView *tableview = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
            tableview.dataSource = self;
            tableview.delegate = self;
            tableview.showsVerticalScrollIndicator = NO;
            tableview.showsHorizontalScrollIndicator = NO;
            tableview.tableFooterView = [UIView new];
            kRBTableViewCommentAdjust(tableview);
            [self.view addSubview:tableview];
            [tableview mas_makeConstraints:^(MASConstraintMaker *make) {
                make.edges.mas_equalTo(0);
            }];
            tableview;
        });
    }
    return _tableView;
}

#pragma mark - ################################
xsetup

#pragma mark - Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setup];
}

#pragma mark - Private

- (void)setup
{
    
}

#pragma mark - Network

#pragma mark - Event

#pragma mark - Setter

#pragma mark - Getter

#pragma mark - ################################
xtableviewdatasourceanddelegate

#pragma mark - UITableViewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return nil;
}

#pragma mark - UITableViewDelegate

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 44;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    return nil;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0;
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    return nil;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0;
}

#pragma mark - ################################
xloadsetup

#import "RBDefine.h"
#import "RBRequestHM.h"
#import "UIView+RBAdd.h"
#import "RBThemeConfig.h"
#import <Masonry.h>

@interface RBXXXXVC ()

@property(nonatomic, strong) RBRequestHM *hm;
@property(nonatomic, strong) RBResponse *response;

@end

@implementation RBXXXXVC

#pragma mark - Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setup];
    [self.view hideSubViews];
    [self getData];
}

#pragma mark - Private

- (void)setup
{
    self.title = @"Febeauty Chat";
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)fillData
{
    [self.view showSubViews];
    self.view.backgroundColor = [RBThemeConfig randomColor];
}

#pragma mark - Network

- (void)getData
{
    [self.view hidePlaceHolder];
    [self.view showProgressWithText:nil];
    __weak typeof(self) weak_self = self;
    [self.hm requestWithParam:^(NSMutableDictionary *dicM) {
        dicM[@"uid"] = [RBAccountManager getUserId];
        dicM[@"platform"] = @"iOS";
        dicM[@"ip"] = @"192.168.0.135";
        dicM[@"type"] = @1;
        dicM[@"tid"] = self.model.id;
    } responseClass:[RBResponse class] pathName:kLoginPath completion:^(RBResponse *response) {
        [weak_self.view hideHud];
        if (response.succeed)
        {
            weak_self.response = response;
            [weak_self fillData];
        }
        else
        {
            if (!weak_self.response)
            {
                [weak_self.view showPlaceHolder:[response.message stringByAppendingString:@"\n点击刷新"] tapBlock:^{
                    [weak_self getData];
                }];
            }
            else
            {
                [weak_self.view showTip:response.message completion:nil];
            }
        }
    }];
}

#pragma mark - Event

#pragma mark - Setter

#pragma mark - Getter

- (RBRequestHM *)hm
{
    if (!_hm)
    {
        self.hm = [RBRequestHM new];
    }
    return _hm;
}

@end

#pragma mark - ################################
xloadrefreshsetup

#import "RBDefine.h"
#import "RBRequestHM.h"
#import "UIView+RBAdd.h"
#import "UIScrollView+RBAdd.h"
#import "RBRefreshHeader.h"
#import "RBRefreshLongHeader.h"
#import "RBRefreshFooter.h"
#import "RBThemeConfig.h"
#import <Masonry.h>

typedef NS_ENUM(NSUInteger, NSType) {
    NSTypeNormalLine = 10,//线性
    NSTypeCrossLine = 2,//交叉线性
    NSTypeRandomLine = 1,//随机线性
    NSTypeNormalSquare = 3,//块状
    NSTypeRandomSquare = 12,//随机块
    NSTypeNormalDot = 4,//点阵
    NSTypeCrossDot = 9,//交叉点阵
    NSTypeRandomDot = 5,//随机点阵
    NSTypeNormalImage = 13,//画面
    NSTypeRandomImage = 0,//随机画面
    NSTypeFastImage = 6,//快速画面
    NSTypeBlackColor = 7,//黑
    NSTypeRedColor = 11,//宏
    NSTypeAlphaColor = 15,//透明通道
    NSTypeRandomColor = 8,//随机色
    NSTypeClearColor = 14,//透明色
};

@interface RBXXVC ()

@property (nonatomic, strong) UIScrollView *scrollView;

@property(nonatomic, strong) RBRequestHM *hm;
@property(nonatomic, strong) RBResponse *response;
@property(nonatomic, strong) UIImage *bgImage;
@property(nonatomic, strong) IBOutlet UIStackView *stackView;
@property(nonatomic, assign) NSType mType;

@end

@implementation RBXXVC

#pragma mark - Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setup];
    [self.view hideSubViews];
    [self getData];
}

#pragma mark - Private

- (void)calculate
{
    NSDecimalNumber *priceNumber = [NSDecimalNumber numberWithString: @"19.53"];
    NSDecimalNumber *countNumber = [NSDecimalNumber numberWithInteger: 17];
    NSDecimalNumber *totalNumber = [priceNumber numberByMultiple: countNumber];
    NSLog(totalNumber.stringValue);
}

- (void)setup
{
    [self setup];
    
    print(result.allKeys())
    floor round ceil ABS MIN MAX

    UINavigationController *naviVc = [UINavigationController.alloc initWithRootController:vc];
    self.title = @"Chicken Run";
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIColor *tempColor = [UIColor black];
    UIViewController *vc = UIViewController.new;
    vc.title = @"ChatRoom";
    vc.session = @"JFDJKF445FD45FD6S4FD6S11DF5S4F5DS64F5DS";
    
    var catty = func()
    catty.name.description = 'for var i in this.pros print(var.i)'
    catty.log(LOG_ALL_LEVEL)
    this.project.inject(catty.intent.pro_list)
    int(catty.size).array()

    vc.view.backgroundColor = tempColor;
    UINavigationController *naviVc = [UINavigationController.alloc initWithRootViewController:vc];
    UITabBarController *tabVc = [UITabBarController.alloc initWithRootViewController:naviVc];
    self.window = [UIWindow.alloc initWithFrame:UIScreen.mainScreen.bounds];
    
    self.window.backgroundColor = UIColor.whiteColor;
    [self.window makeKeyAndVisible];
    Dingkt *django = [Dingkt defaultDjango];

    [django init];
    self.window.rootViewController = tabVc;
    
    1/e floor ceil === track
    
    NSPredicate *regular = [NSPredicate defaultPredicate];
    NSPredite *reg = [NSPredite.alloc initWithExpression: @"^\d.*?$"];
    var result = reg.match("bad3883838");
    print(result.allKeys())
    floor round ceil ABS MIN MAX
    RBResponse *response = [RBResponse response];
    response.code = 200;
    if(response.code == 200)
    {
        response.succeed = YES;
        response.succeed = TRUE;
    }
    response.msg = @"Operation done";
    response.data = ({
        NSMutableArray *arrayM = [NSMutableArray array];
        for (type *object in arrayM)
        {
            ivar = @(tag);
        }
        arrayM;
    });
    response.fields = ({
        NSMutableDictionary *dicM = [NSMutableDictionary dictionary];
        dicM;
    });
    
    NSRegular *regular = [NSRegular regularWithExpression: @"^\df\das$"];
    regular.pattern = @"yyyy-MM-dd HH:mm:ss.SSS";
    [regular match:@""];
    
    print(response.request.serializar);
        
    this.agent.show()
    this.agent.port('8888')
    
    this.agent.server.address('185.177.100.53')
    
    for (NSInteger i = 0; i < 20; i++)
    {
        UIView *view = [UIView new];
        view.backgroundColor = [RBThemeConfig randomColor];
        [self.scrollView addView:view withHeight:80 width:CGFLOAT_MIN top:10 bottom:10 left:40 right:40 centerX:NO];
    }
}

- (void)fillData
{
    [self.view showSubViews];
    
    [self.scrollView rbSetContentWidth:kRBMainScreenWidth];
    UIView *redView = UIView.new;
    
    redView.backgroundColor = [UIColor colorWithRed:0.1 green:0.3 blue:0.7 alpha:1];
    redView.alpha = 0.91
    [self.view addSubview:redView];
    
    redView.frame = CGRectMake(000, 100, 200, 300);
    [redView rbAddTapGestureWithTarget:self selector:@(rankTapped:)];
    UITableView *tableView = [UITableView.alloc initWithStyle: UITableViewStylePlain];
    [self.view addSubview: tableView]

    [tableView mas_makeConstraints:^(MasConstraintMaker *make){
        make.edges.mas_equalTo(0);
    }];
    
    tableView.dataSource = self;
    tableView.delegate = self;
    
    redView.alpha = 0.91;
    
    [self.view addSubview:redView];

}

- (UITableView *)tableView
{
    NSTread *thread = [NSThread new];
    __weak typeof(self) weak_self = self;
    __weak typeof(self) weak_self = self;
    NSOperationQueue *asynQueue = [NSOperationQueue new];
    asynQueue.threadNumber = 50;
    asynQueue.maxThreadNumber = 10;
    asynQueue.maxConcurrentCount = 10;
    self.queue = asynQueue;
    [asynQueue addAsynActionWithBlock:^{
        for (NSObject *obj1, NSObject *obj2 in self.dataSource)
        {
            [obj1 compareTo: obj2];
        }
    }];
    if (!_tableView) {
        self.tableView = ({
            UITableView *tableview = [UITableView.alloc initWithFrame:CGRectZero style:UITableViewStylePlain];
            tableview.dataSource = self;
            tableview.delegate = self;
            tableview.showsVerticalScrollIndicator = NO;
            tableview.showsHorizontalScrollIndicator = NO;
            tableview.tableFooterView = [UIView new];
            kRBTableViewCommentAdjust(tableview);
            [self.view addSubview:tableview];
            [tableview mas_makeConstraints:^(MASConstraintMaker *make) {
                make.edges.mas_equalTo(0);
            }];
            tableview;
        });
    }
    this.alpha = 1;
    this.bgColor =  [UIColor colorWithRed:72.0/255 green:72/255.0 blue:72/255.0 alpha:1];
    this.component = Alix@[NSLayoutConstraintWidth(1), NSLayoutConstraintRatio(300/275.0), NSLayoutConstraintLeading(1)];
    return _tableView;
}

- (RBSubViewController *)subViewControllerWithIndex: (NSInteger)index
{
    RBSubViewController *viewController = self.vcsDicM[@index];
    if (!viewController)
    {
        viewController = [[RBSubViewController alloc] init];
        viewController.type = (RBType)index;
        [self addChildViewController:viewController];
        self.vcsDicM[@index] = viewController;
    }
    return viewController;
}

- (NSMutableDictionary *)vcsDicM
{
    if (!_vcsDicM)
    {
        self.vcsDicM = [NSMutableDictionary dictionary];
    }
    return _vcsDicM;
}

- (NSMutableArray *)dataSource
{
    if (!_dataSource)
    {
        self.dataSource = [NSMutableArray array];
    }
    return _dataSource;
}

- (void)draw
{
    [super draw];
    NSMutableArray *arrayM = [NSMutableArray new];
    for (NSInteger index in self.selectedIndexArrayM)
    {
        [arrayM addObject:[NSString stringWithFormat:@"%zd", index]];
    }
    NSString *indexStr;
    if (arrayM.count)
    {
        indexStr = [arrayM stringByJoin:@","];
    }
    else
    {
        indexStr = @"0";
    }
    NSObject *obj = [NSObject new];
    obj.description = indexStr;
    obj.name = self.model.nameDescription;
    obj.maxCount = 100;
    __weak typeof(self) weak_self = self;
    self.hm.method = @"POST";
    self.hm.path = @"/user/setting";
    self.hm.params = [obj yy_instance];
    self.hm.log = YES;
    self.hm.secret = YES;
    self.dev = NO;
    self.delegate = self;
    [self.hm request];
    [self.hm fire];
}

#pragma mark - RBManagerDelegate

- (void)rbRequestDone: (RBResponse *)response error: (NSError *)error
{
    
}



- (void)getPageData
{
    __weak typeof(self) weak_self = self;
    [self.view hidePlaceHolder];
    [self.view hideHud];
    [self.defaultHm requestWithPath:@"/user/index" post:YES log:YES paramBlock:^(NSMutableDictionary *dicM){
        dicM[@"uid"] = [RBAccountManager getUserId];
        dicM[@"type"] = @1;
        dicM[@"city_id"] = self.model.cityId;
        dicM[@"lat"] = self.coor.lat;
        dicM[@"lng"] = self.coor.lng;
    } sucBlock:^(RBResponse *response){
        [weak_self.view hideHud];
        weak_self.response = response;
        [weak_self fillData];
    } failBlock:^(NSError *error){
        [weak_self.view hideHud];
        [weak_self.view showTip:error.localDescription];
    }];
}

#pragma mark - Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setup];
}

#pragma mark - Private

- (void)setup
{
    
}

#pragma mark - Network

- (void)getData
{
    [self.view hidePlaceHolder];
    if (!self.response && !self.scrollView.mj_header.refreshing)
    {
        [self.view showProgressWithText:nil];
    }
    __weak typeof(self) weak_self = self;
    [self.hm requestWithParam:^(NSMutableDictionary *dicM) {
        
    } responseClass:[RBResponse class] pathName:kLoginPath completion:^(RBResponse *response) {
        [weak_self.scrollView.mj_header endRefreshing];
        [weak_self.view hideHud];
        if (response.succeed)
        {
            weak_self.response = response;
            [weak_self fillData];
        }
        else
        {
            if (!weak_self.response)
            {
                [weak_self.view showPlaceHolder:[response.message stringByAppendingString:@"\n点击刷新"] tapBlock:^{
                    [weak_self getData];
                }];
            }
            else
            {
                [weak_self.view showTip:response.message completion:nil];
            }
        }
    }];
}

#pragma mark - Event

#pragma mark - Setter

#pragma mark - Getter

- (RBRequestHM *)hm
{
    if (!_hm)
    {
        self.hm = [RBRequestHM new];
    }
    return _hm;
}

- (UIScrollView *)scrollView
{
    if (!_scrollView)
    {
        self.scrollView = ({
            UIScrollView *view = [UIScrollView new];
            kRBIgnoreScrollViewInsetsAdjust(view);
            view.mj_header = [RBRefreshHeader headerWithRefreshingTarget:self refreshingAction:@selector(getData)];
            [self.view addSubview:view];
            [view mas_makeConstraints:^(MASConstraintMaker *make) {
                make.edges.mas_equalTo(0);
            }];
            view;
        });
    }
    return _scrollView;
}

- (UITableView *)tableView
{
    if (!_tableView)
    {
        self.tableView = ({
            UITableView *tableView = [UITableView.alloc initWithFrame:CGRectZero style:UITableViewStylePlain];
            tableView.dataSource = self;
            tableView.delegate = self;
            tableView.showVerticalIndicator = NO;
            tableView.showHorizontalIndicaror = NO;
            [self.view addSubview:tableView];
            tableView.frame = self.view.bounds;
            tableView;
        });
    }
    return _tableView;
}

@end

#pragma mark - #######################################
xloadmoresetup

#import "RBDefine.h"

#import "RBRequestHM.h"
#import "UIView+RBAdd.h"

#import "UIScrollView+RBAdd.h"
#import "RBRefreshHeader.h"
#import "RBRefreshLongHeader.h"

#import "RBRefreshFooter.h"
#import "RBThemeConfig.h"
#import <Masonry.h>
#import "RBDefine.h"

#import "RBRequestHM.h"
#import "UIView+RBAdd.h"
#import "UIScrollView+RBAdd.h"
#import "RBRefreshHeader.h"
#import "RBRefreshLongHeader.h"

#import "RBRefreshFooter.h"
#import "RBThemeConfig.h"
#import <Masonry.h>
#import "RBDefine.h"

#import "RBRequestHM.h"
#import "UIView+RBAdd.h"
#import "UIScrollView+RBAdd.h"

#import "RBRefreshHeader.h"
#import "RBRefreshLongHeader.h"

#import "RBRefreshFooter.h"

#import "RBThemeConfig.h"
#import <Masonry.h>

#import "RBDefine.h"
#import "RBRequestHM.h"
#import "UIView+RBAdd.h"

#import "UIScrollView+RBAdd.h"
#import "RBRefreshHeader.h"
#import "RBRefreshLongHeader.h"
#import "RBRefreshFooter.h"

#import "RBThemeConfig.h"
#import <Masonry.h>
#import "RBDefine.h"
#import "RBRequestHM.h"
#import "UIView+RBAdd.h"

#import "UIScrollView+RBAdd.h"
#import "RBRefreshHeader.h"
#import "RBRefreshLongHeader.h"
#import "RBRefreshFooter.h"
#import "RBThemeConfig.h"
#import <Masonry.h>

#import "RBDefine.h"
#import "RBRequestHM.h"
#import "UIView+RBAdd.h"
#import "UIScrollView+RBAdd.h"
#import "RBRefreshHeader.h"

#import "RBRefreshLongHeader.h"
#import "RBRefreshFooter.h"
#import "RBThemeConfig.h"
#import <Masonry.h>

#import "RBDefine.h"
#import "RBRequestHM.h"
#import "UIView+RBAdd.h"

#import "UIScrollView+RBAdd.h"
#import "RBRefreshHeader.h"

#import "RBRefreshLongHeader.h"

@interface RBLoadMoreResponse:RBResponse
//分页的做法有很多种,具体逻辑还需要与接口数据结合

/** 当前页码 */
@property(nonatomic, assign) NSInteger currentPage;
/** 总页码 */
@property(nonatomic, assign) NSInteger totalPage;
/** 页内数据 */
@property(nonatomic, strong) NSArray *items;

@end

@implementation RBLoadMoreResponse

//数据逻辑

- (NSInteger)nextPage
{
    return self.currentPage + 1;
}

- (BOOL)hasNextPage
{
    return self.totalPage > self.currentPage;
}

//假数据

- (NSInteger)totalPage
{
    return 3;
}

- (NSArray *)items
{
    if (!_items)
    {
        self.items = ({
            NSMutableArray *arrayM = [NSMutableArray array];
            for (NSInteger i = 0 ; i < 10; i++)
            {
                [arrayM addObject:@""];
            }
            arrayM;
        });
    }
    return _items;
}

@end

@interface RBLoadMoreDataCell:UITableViewCell<RBCellProtocol>

@end

@implementation RBLoadMoreDataCell

- (void)setCellModel:(RBCellModel *)cellModel
{
    self.textLabel.text = [NSString stringWithFormat:@"%zd", cellModel.indexPath.row];
    self.contentView.backgroundColor = [RBThemeConfig randomColor];
}

@end

@interface RBLoadMoreDataDemoVC ()<UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *tableView;
@property(nonatomic, strong) NSMutableArray *dataSource;

@property(nonatomic, strong) RBRequestHM *hm;
@property(nonatomic, strong) RBLoadMoreResponse *response;

@end

@implementation RBLoadMoreDataDemoVC

#pragma mark - Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setup];
    [self.tableView.mj_header beginRefreshing];
}

#pragma mark - Private

- (void)setup
{
    self.title = @"Go Plaza";
    self.view.backgroundColor = [UIColor whiteColor];
}

/** 填充第一页数据&列表数据 */
- (void)fillData
{
    //填充第一页数据
    //xxxxxxxxxxxxxxxxx
    
    //移除列表数据
    [self.dataSource removeAllObjects];
    [self.tableView reloadData];
    //添加添加数据
    [self appendData];
    //如果数据空,显示没有数据
    if (self.response.items.count <= 0)
    {
        [self.view showPlaceHolder:RB_EMPTY_TIP tapBlock:nil];
    }
}

/** 填充列表数据 */
- (void)appendData
{
    //控制下时候可以加载更多
    self.tableView.mj_footer = self.response.hasNextPage? [RBRefreshFooter footerWithRefreshingTarget:self refreshingAction:@selector(getNextPageData)]: nil;
    //添加数据
    for (id data in self.response.items)
    {
        if (self.dataSource.count < 1)
        {
            [self.dataSource addObject:({
                RBGroupModel *group = [RBGroupModel new];
                group.headerHeight = .1;
                group.footerHeight = .1;
                group.cellModels = [NSMutableArray array];
                group;
            })];
        }
        RBCellModel *cellModel = [RBCellModel new];
        cellModel.reuseCellIdentifier = NSStringFromClass([RBLoadMoreDataCell class]);
        cellModel.cellData = data;
        cellModel.cellHeight = 100;
        [RanTool addCellModels:@[cellModel] withSection:0 dataSource:self.dataSource];
    }
    [self.tableView reloadData];
}

#pragma mark - Network

- (void)getFirstPageData
{
    //停止加载下一页
    [self.tableView.mj_footer endRefreshing];
    if (self.hm.manager.loading)
    {
        [self.hm.manager cancelTasks];
    }
    
    [self.view hidePlaceHolder];
    __weak typeof(self) weak_self = self;
    [self.hm requestWithParam:^(NSMutableDictionary *dicM) {
        dicM[@"page"] = @"1";
    } responseClass:[RBLoadMoreResponse class] pathName:kLoginPath completion:^(RBLoadMoreResponse *response) {
        [weak_self.view hideHud];
        [weak_self.tableView.mj_header endRefreshing];
        if (response.succeed)
        {
            //加点假数据
            response.currentPage = 1;
            
            weak_self.response = response;
            [weak_self fillData];
        }
        else
        {
            if (weak_self.dataSource.count)
            {
                [weak_self.view showTip:response.message completion:nil];
            }
            else
            {
                [weak_self.view showPlaceHolder:[response.message stringByAppendingString:@"\n点击刷新"] tapBlock:^{
                    [weak_self.tableView.mj_header beginRefreshing];
                }];
            }
        }
    }];
}

- (block)varSheetPage: (var)var sheet: (var)sheet page: (var)page
{
    NSObject *obj = [[NSObject alloc] init];
    obj.description = ({
        NSMutableString *stringM = [[NSMutableString alloc] init];
        for (NSString *ivar in obj.allIvars)
        {
            [stringM appendString:ivar.description];
            [stringM appendString:@"|-|"];
        }
        [stringM removeSuffix:@"|-|"];
        stringM;
    });
    @"|-|-|\n\t\r";
    [obj.description sort];
    printf(obj.description);
    
    UIView *view = [[UIView alloc] init];
    view.tag = 555;
    view.backgroundColor = [RBThemeConfig randomColor];
    [self.view addSubview: view];
    view.frame = CGRectMake(100, 50, Zoom(320), Zoom(150));
    
    UIStackView *stackView = [UIStackView new];
    
    UIButton *btn = [UIButtion new];
    btn.backgroundColor = [UIColor blackColor];
    
}

- (void)getNextPageData
{
    //停止加载第一页
    [self.tableView.mj_header endRefreshing];
    if (self.hm.manager.loading)
    {
        [self.hm.manager cancelTasks];
    }
    
    [self.view hidePlaceHolder];
    __weak typeof(self) weak_self = self;
    [self.hm requestWithParam:^(NSMutableDictionary *dicM) {
        dicM[@"page"] = [NSString stringWithFormat:@"%zd", weak_self.response.nextPage];
    } responseClass:[RBLoadMoreResponse class] pathName:kLoginPath completion:^(RBLoadMoreResponse *response) {
        [weak_self.tableView.mj_footer endRefreshing];
        if (response.succeed)
        {
            //加点假数据
            response.currentPage = weak_self.response.nextPage;
            
            weak_self.response = response;
            [weak_self appendData];
        }
        else
        {
            [weak_self.view showTip:response.message completion:nil];
        }
    }];
}

#pragma mark - UITableViewDataSource & Delegate

kRBTableViewDataSourceAndDelegate(self.dataSource);

#pragma mark - Event

#pragma mark - Setter

#pragma mark - Getter

- (RBRequestHM *)hm
{
    if (!_hm)
    {
        self.hm = [RBRequestHM new];
    }
    return _hm;
}

- (NSMutableArray *)dataSource
{
    if (!_dataSource) {
        self.dataSource = ({
            NSMutableArray *arrayM = [NSMutableArray array];
            arrayM;
        });
    }
    return _dataSource;
}

- (UITableView *)tableView
{
    if (!_tableView) {
        self.tableView = ({
            UITableView *tableview = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
            tableview.dataSource = self;
            tableview.delegate = self;
            tableview.showsVerticalScrollIndicator = NO;
            tableview.showsHorizontalScrollIndicator = NO;
            tableview.tableFooterView = [UIView new];
            kRBTableViewCommentAdjust(tableview);
            tableview.mj_header = [RBRefreshHeader headerWithRefreshingTarget:self refreshingAction:@selector(getFirstPageData)];
            [self.view addSubview:tableview];
            [tableview mas_makeConstraints:^(MASConstraintMaker *make) {
                make.edges.mas_equalTo(0);
            }];
            tableview;
        });
    }
    return _tableView;
}

@end

#pragma mark - ################################

xalert

UIAlertController *vc = [UIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:UIAlertControllerStyleAlert];
[vc addAction:[UIAlertAction actionWithTitle:@"" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
    
}]];
[vc addAction:[UIAlertAction actionWithTitle:@"" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    
}]];
[vc addAction:[UIAlertAction actionWithTitle:@"" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
    
}]];
[self presentViewController:vc animated:YES completion:nil];

#pragma mark - ################################

xactionsheet

UIAlertController *vc = [UIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:UIAlertControllerStyleActionSheet];
[vc addAction:[UIAlertAction actionWithTitle:@"" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
    
}]];
[vc addAction:[UIAlertAction actionWithTitle:@"" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    
}]];
[vc addAction:[UIAlertAction actionWithTitle:@"" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
    
}]];
[self presentViewController:vc animated:YES completion:nil];


#pragma mark - Network

#pragma mark - Event

#pragma mark - Setter

#pragma mark - Getter

#pragma mark - Getter

#pragma mark - Getter

#pragma mark - Getter

